<{include file="Public:header" /}>
<div id="page-wrapper">
	<div class="row">
		<div class="col-lg-12">
			<h1 class="page-header" style="margin-top: 0px;"></h1>
		</div>
		<!-- /.col-lg-12 -->
	</div>
	<div class="row">
		<div class="col-lg-12">
			<div class="panel panel-default">
				<div class="panel-heading">
					<b>系统配置</b><b style="padding-left: 90px;"> <input type="button"
						class="button button-success" id="success" value="触发" /></b>
				</div>
				<!-- /.panel-heading -->
				<div class="panel-body">
					<div class="dataTable_wrapper">
						<div id="dataTables-example_wrapper"
							class="dataTables_wrapper form-inline dt-bootstrap no-footer">
							<div class="row">

								<div class="row">
									<div class="col-sm-12">

										<table
											class="table table-striped table-bordered table-hover dataTable no-footer">
											<thead>
												<tr role="row">
													<th style="text-align: center;">配置名称</th>
													<th style="text-align: center;">对应值</th>
													<th style="text-align: center;">描述</th>
													<th style="text-align: center;">操作</th>

												</tr>
											</thead>
											<tbody>
												<{volist name="list" id='vo' }>
												<tr class="gradeA odd" role="row">
													<td style="text-align: center;"><{$vo.name}></td>
													<td style="text-align: center;"><{$vo.value}></td>
													<td style="text-align: center;"><{$vo.temp}></td>
													<td style="text-align: center;"><a class="eduitsys"
														href="javascript:void(0)"
														onclick="eduitsys('<{$vo.name}>','<{$vo.value}>','<{$vo.temp}>')">编辑</a>
														| <a class="deletebuilding" href="javascript:void(0)"
														onclick="deletesys('<{$vo.name}>')">删除</a></td>

												</tr>
												<{/volist}>

											</tbody>
										</table>
									</div>
								</div>

								<div class="row">
									<div class="col-sm-12">
										<div class='pages'></div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<!-- /.panel-body -->
				</div>
				<!-- /.panel -->
			</div>
			<!-- /.col-lg-12 -->
		</div>

	</div>

	<!-- 编辑配置-->
	<div id="eduitsys" class="hide">
		<!--     action+"__URL__/upload" enctype="multipart/form-data" method="post" -->
		<form class="form-horizontal">
			<div class="row">
				<div class="control-group span10">
					<label class="control-label" style="padding-top: 0px; width: 140px">配置名称：</label>
					<div class="controls">
						<input type="text" id="name" class="input-normal control-text"
							readonly="readonly" style="height: 30px;">
					</div>
				</div>
				<div class="control-group span8">
					<label class="control-label" style="padding-top: 0px; width: 140px">对应值：</label>
					<div class="controls">
						<input type="text" id="value" class="input-normal control-text"
							style="height: 30px;">
					</div>
				</div>
				<div class="control-group span8">
					<label class="control-label" style="padding-top: 0px; width: 140px">描述：</label>
					<div class="controls">
						<input type="text" id="temp" class="input-normal control-text"
							style="height: 30px;">
					</div>
				</div>
				<div class="control-group span8" style="display: none;">
					<label class="control-label" style="padding-top: 0px; width: 140px">ID：</label>
					<div class="controls">
						<input type="text" id="id" class="input-normal control-text">
					</div>
				</div>

			</div>
		</form>
	</div>

	<script src="__PUBLIC__/js/jquery-1.8.3.min.js" type="text/javascript">
		
	</script>
	<script src="__PUBLIC__/js/bui.js"></script>
	<script type="text/javascript">
		var Overlay = BUI.Overlay;
		$(document).ready(function() {

			$("#checkedAll").click(function() {
				if ($(this).prop('checked')) { // 全选 
					$("input[name='checkbox_name']").each(function() {
						$(this).prop('checked', true);
					});
				} else { // 取消全选 
					$("input[name='checkbox_name']").each(function() {
						$(this).prop('checked', false);
						;
					});
				}
			});

		});
		//编辑
		function eduitsys(name, value, temp) {
			$('#name').val(name);
			$('#value').val(value);
			$('#temp').val(temp);
			var dialog = new Overlay.Dialog({
				title : '修改配置信息',
				width : 450,
				height : 400,
				closeAction : 'destroy', //每次关闭dialog释放
				contentId : 'eduitsys',
				buttons : [ {
					text : '提交修改',
					elCls : 'button button-primary',
					handler : function() {
						$id = $('#id').val();
						$name = $('#name').val();
						$value = $('#value').val();
						$temp = $('#temp').val();
						$.post('__URL__/ajaxeduitsys', {
							'name' : $name,
							'value' : $value,
							'temp' : $temp
						}, function(data) {
							if (data) {
								dispoint("修改配置信息成功");
								dialog.close();
								location.reload();
							} else {
								dispoint("修改配置信息失败");
							}
						})
					}
				}, {
					text : '取消',
					elCls : 'button',
					handler : function() {
						this.close();
					}
				} ]
			});
			dialog.show();
		}

		function deletesys(name) {
			BUI.Message.Confirm('确认要删除？', function() {
				setTimeout(function() {
					$.ajax({
						type : 'post',
						url : '__URL__/ajaxdeletesys',
						data : {
							'name' : name
						},
						dataType : 'json',
						success : function(msg) {
							dispoint("删除成功！");
							location.reload();
						}
					});

					//BUI.Message.Alert('这只是简单的错误信息','error');
				});

			}, 'question');
		}
		//重置
		$('#success').click(function() {
			$.ajax({
				type : 'post',
				url : '__URL__/udpresert',
				success : function(result) {
					dispoint("触发成功！");
				}
			})
		})
	</script>

	<!-- 删除用户 -->
	<script type="text/javascript">
		//消息消失
		function dispoint(messge) {
			BUI.Message.Show({
				msg : messge,
				icon : 'success',
				buttons : [],
				autoHide : true,
				autoHideDelay : 1000

			});
		}

		function show(hidden) {
			BUI.Message.Confirm('确认要删除？', function() {
				setTimeout(function() {
					$.ajax({
						type : 'get',
						url : '__URL__/delCommager?id=' + hidden,
						success : function(msg) {
							dispoint("删除成功！");
							location.reload();
						}
					});

					//BUI.Message.Alert('这只是简单的错误信息','error');
				});

			}, 'question');
		}

		$('.yaodel_btnShow').on('click', function() {
			var hidden = $(this).parent().prev().find("input").val();
			show(hidden);
		});
	</script>
	<{include file="Public:footer" /}>